import mongoose from 'mongoose'
// 生成Schema模型
const Schema = mongoose.Schema
const StudentSchema = new Schema({
  studentNumber: {
    // 类型
    type: String,
    // 唯一的
    unique: true,
    // 必须的
    require: true
  },
  name: {
    type: String,
    require: true
  },
  sex: {
    type: String
  },
  college: {
    type: String
  },
  class: {
    type: String
  },
  tower: {
    type: String
  },
  dorm: {
    type: String
  },
  tel: {
    type: String,
    // require: true
  },
  studentImage: {
    type: String,
    default: null
  }
})

export default mongoose.model('Student', StudentSchema, 'student')
